package com.baidu.leetcode.test;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author shilei
 * @create 2022-04-13 14:40
 */
@Component
public class Factory {

    @Resource(name = "AServiceImpl")
    private AService aService;
    @Resource(name = "BServiceImpl")
    private AService bService;
    @Resource(name = "CServiceImpl")
    private AService cService;

    public static AService doPro(String type){
        if (type.equals("1")) {
            return new AServiceImpl();
        }else if (type.equals("2")){
            return new BServiceImpl();
        }else if (type.equals("3")){
            return new CServiceImpl();
        }
        return null;
    }
}
